﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using MyCalendar.Utils;

namespace MyCalendar.UIcomponent
{
    public partial class DayList : UserControl
    {
        public DayList ()
        {
            InitializeComponent ();

            DailyTask _Task = new DailyTask
            {
                Title = "TITLE",
                Description = "HELLO !!",
                StartTime = new DateTime(2012,10,12,12,0,0),
                EndTime = new DateTime (2012, 10, 12, 15, 0, 0)
            };
            DailyTask _Task2 = new DailyTask
            {
                Title = "TITLE",
                Description = "HELLO !!",
                StartTime = new DateTime (2012, 10, 12, 16, 0, 0),
                EndTime = new DateTime (2012, 10, 12, 18, 0, 0)
            };

            DailyTask _Task3 = new DailyTask
            {
                Title = "TITLE",
                Description = "HELLO !!",
                StartTime = new DateTime (2012, 10, 12, 08, 0, 0),
                EndTime = new DateTime (2012, 10, 12, 20, 0, 0)
            };

            DailyTaskListItem _Item6 = new DailyTaskListItem (_Task3, 4, 1);
            DailyTaskListItem _Item7 = new DailyTaskListItem (_Task3, 4, 2);
            DailyTaskListItem _Item8 = new DailyTaskListItem (_Task3, 4, 3);
            DailyTaskListItem _Item9 = new DailyTaskListItem (_Task3, 4, 4);

            DailyTaskListItem _Item = new DailyTaskListItem (_Task,3,1);
            DailyTaskListItem _Item2 = new DailyTaskListItem (_Task, 3, 2);
            DailyTaskListItem _Item3 = new DailyTaskListItem (_Task, 3, 3);
            DailyTaskListItem _Item4 = new DailyTaskListItem (_Task2, 2, 1);
            DailyTaskListItem _Item5 = new DailyTaskListItem (_Task2, 2, 2);
            
            AddTask (_Item6);
            AddTask (_Item7);
            AddTask (_Item8);
            AddTask (_Item9);
            AddTask (_Item);
            AddTask (_Item2);
            AddTask (_Item3);
            AddTask (_Item4);
            AddTask (_Item5);

           // AddTask (_Item3);

        }

        private void AddTask (DailyTaskListItem pItem)
        {
            LayoutRoot.Children.Add (pItem);
        }
        
    }
}
